#!/bin/sh
for file in *.cpp; do
  echo "${file%.*}" 
  uname_s=$(uname -s)
  if [ "$uname_s" = "Darwin" ]; then
    g++ -g -std=c++11 $file -o ${file%.cpp} -lboost_system -lpthread -lboost_serialization -lboost_context-mt -lboost_fiber-mt 
  # Mac OS X operating system
  elif [ "$uname_s" = "Linux" ]; then   
    g++ -g -std=c++11 $file -o ${file%.cpp} -lboost_system -lpthread -lboost_serialization -lboost_context -lboost_fiber
  #./${file%.cpp}
  else
    echo "Unsupported platform: $uname_s"
    exit 1
  fi
done